<template>
  <div>
    首页
    <el-button @click="btnClick">切换语言</el-button>
    <h3>{{ $t('xxx') }}</h3>
    <!-- <HmNum v-model="fatherNum" /> -->
  </div>
</template>

<script>
export default {
  data() {
    return {
      // fatherNum: 1
    }
  },
  methods: {
    btnClick() {
      const langArr = ['zh', 'en']
      const _index = langArr.indexOf(this.$i18n.locale)
      this.$i18n.locale = langArr[1 - _index]
      console.log(this.$i18n.locale)
    }
  }
}
</script>

<style></style>
